let a = [];

for (let i = 0; i < 10; i++) {
  a[i] = i;
}

function mixArr(arr) {
  let narr = [];
  arr.forEach((e, i) => {
    narr[i] = arr.splice(Math.floor(Math.random() * a.length - i), 1)[0];
  });

  return narr
}

mix(a);
